﻿//************************************************//
//Author:Nguyen Tan Phat
//MSSV:1173025
//Class:11HT
#region
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using DTO;
using DAO;

namespace BUS
{
    public class ChiTietHoaDonBUS
    {
        public static ChiTietHoaDonDTO SelectByPhong(int maPhong, DateTime ngayTraPhong)
        {
            SqlDataReader reader = ChiTietHoaDonDAO.SelectByPhong(maPhong, ngayTraPhong);
            ChiTietHoaDonDTO cthoadon = new ChiTietHoaDonDTO();
            while (reader.Read())
            {
                cthoadon.MaPhieuThue = Convert.ToInt32(reader[0]);
                cthoadon.MaPhong = Convert.ToInt32(reader[1]);
                cthoadon.SoNgayThue = Convert.ToInt32(reader[2]);
                cthoadon.DonGia = Convert.ToInt32(reader[3]);
                cthoadon.Tien = Convert.ToInt32(reader[4]);
            }
            return cthoadon;
        }
    }
}
#endregion
//************************************************//

